define(
    function (require) {
        require('tpl!./form.tpl.html');

        var u = require('underscore');

        var BaseFormView = require('common/FormView');

        function FreshFormView() {
            BaseFormView.apply(this, arguments);
        }

        FreshFormView.prototype.template = 'freshForm';

        FreshFormView.prototype.enterDocument = function() {
            BaseFormView.prototype.enterDocument.apply(this, arguments);
            var me = this;
            var uploader = me.get('pics-uploader');
            uploader.on(
                'onecomplete',
                function (event) {
                    me.fire('upload', event);
                }
            );
        };

        /**
         * 从表单中获取实体数据
         *
         * @return {Object}
         */
        FreshFormView.prototype.getEntity = function () {
            var entity = BaseFormView.prototype.getEntity.apply(this, arguments);
            return entity;
        };

        require('er/util').inherits(FreshFormView, BaseFormView);
        return FreshFormView;
    }
);
